package com.jarvis.zeng.design.pattern.filter.demo;

import java.util.Iterator;
import java.util.List;

public class MaleCriteria implements Criteria {

    public List<Person> meetCriteria(List<Person> personList) {
        Iterator<Person> iterator = personList.iterator();
        while(iterator.hasNext()){
            Person person = iterator.next();
            if(!person.getGender().equals("男性")){
                iterator.remove();
            }
        }
        return personList;
    }
}
